package com.merry.jedis.controller;

import com.merry.jedis.service.OrderService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import javax.annotation.Resource;

@Controller
public class OrderController {

    @Resource
    private OrderService orderService;

    @PostMapping("/order/add")
    public void addOrder(){
        orderService.addOrder();
    }

    @GetMapping("/order/{keyId}")
    public void addOrder(@PathVariable Integer keyId){
        orderService.getOrderById(keyId);
    }
}
